<?php

use think\facade\Route;

Route::rule('zhang/xiaotian', 'index/hello');

Route::rule('think', function () {
    return 'hello,ThinkPHP6!';
});

Route::domain('blog', function () {
    // 动态注册域名的路由规则
    Route::rule('new/:id', 'news/read');
    Route::rule(':user', 'user/info');
});

Route::domain('www', function () {
    // 动态注册域名的路由规则
    Route::rule('new/:id', 'news/read');
    Route::rule(':user', 'user/info');
});

Route::domain('api', function () {
    // 动态注册域名的路由规则
    Route::rule('new/:id', 'index/hello');
    Route::rule(':user', 'index/hello');
    Route::rule('zhang/xiaotian', 'index/hello');
});